/*
 * -*- mode: C; c-basic-offset: 8 -*-
 * 
 * args.c - Print ARGV to stdout
 * 
 * Copyright (c) 2010 Ruda Moura
 */

#include <stdio.h>
#include <string.h>

char           *PROGRAM = NULL;
char           *VERSION = "2010";

void
usage()
{
	printf("Usage:\n");
	printf("  -h, --help\t\tThis help message\n");
	printf("  -v, --version\t\tPrint version\n");
}

void
version()
{
	printf("%s version %s\n", PROGRAM, VERSION);
	printf("Copyright (c) 2010 Ruda Moura\n");
}

int
main(int argc, char *argv[])
{
	PROGRAM = *argv++;

	if ((*argv) && (!strcmp(*argv, "-h") || !strcmp(*argv, "--help"))) {
		usage();
		return 0;
		/* argv++; */
	}
	if ((*argv) && (!strcmp(*argv, "-v") || !strcmp(*argv, "--version"))) {
		version();
		return 0;
		/* argv++; */
	}
	while (*argv)
		puts(*argv++);

	return 0;
}
